package com.boss.salary.service.impl;

import com.boss.salary.dao.IConfigCtrlDao;
import com.boss.salary.entity.ConfigCtrl;
import com.boss.salary.service.IConfigCtrlService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ConfigCtrlServicelmpl implements IConfigCtrlService {
    @Autowired
    private IConfigCtrlDao IConfigCtrlDao;

    @Override
    public List<ConfigCtrl> selectConfigCtrl(String province) {
        List<ConfigCtrl> list = IConfigCtrlDao.selectConfigCtrl(province);
        return list;
    }


    @Override
    public void updataIsAbleConfigCtrl(String province,List<ConfigCtrl> configCtrls) {
        if (configCtrls.size() > 0) {
            // 先删除
            IConfigCtrlDao.deletedConfigCtrl(province);
            //保存
            IConfigCtrlDao.saveConfigCtrl(configCtrls, province);
        }
    }

    @Override
    public int selectFuncName(String province) {
        return IConfigCtrlDao.selectFuncName(province);
    }


}
